/* file-viewer.css */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;600&display=swap');

:root {
  --primary-color: #007bff; /* A nice blue for active states and highlights */
  --secondary-bg: #f5f7fa; /* Light background for the sidebar */
  --border-color: #e0e0e0; /* Soft border color */
  --text-color: #333; /* Main text color */
  --lighter-text: #666; /* Secondary text color */
}

.file-viewer-container {
  display: flex;
  flex-direction: row;
  height: 800px;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.file-tabs-sidebar {
  width: 280px;
  padding: 20px;
  background-color: var(--secondary-bg);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
}

.file-tabs-sidebar h3 {
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--text-color);
  font-size: 1.2em;
  font-weight: 600;
}

.file-item-wrapper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-color);
  background-color: #fff;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}

.file-item-wrapper:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.active-file-item {
  border-color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(0, 123, 255, 0.2);
  background-color: var(--secondary-bg);
  position: relative;
}

.active-file-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background-color: var(--primary-color);
  border-radius: 6px 0 0 6px;
}

.active-file-item .file-tab-button {
  color: var(--primary-color);
  font-weight: 600;
}

.file-tab-button {
  flex-grow: 1;
  padding: 12px 10px 12px 18px;
  border: none;
  background: none;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-color);
  font-size: 0.95em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-tab-button .file-index {
  font-size: 0.85em;
  color: var(--lighter-text);
}

.file-tab-button .file-name-display {
  font-weight: 500;
}

.active-file-item .file-tab-button .file-index {
  color: var(--primary-color);
}

.download-button {
  flex-shrink: 0;
  width: 48px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border-left: 1px solid var(--border-color);
  color: var(--text-color);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-left-color 0.2s ease;
}

.download-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary-color);
}

.active-file-item .download-button {
  background-color: transparent;
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}

.active-file-item .download-button:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.download-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.iframe-container {
  flex-grow: 1;
  padding: 20px;
  height: 100%;
  box-sizing: border-box;
  background-color: #fff;
  border-right: 1px solid var(--border-color);
  padding-right: 0;
}

.file-iframe {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  height: 100%;
  width: 100%;
}
